package com.example.ipccore;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class BBBinder {
    /**
     * 构建对象
     * @param method
     * @param parameters
     * @return
     */
    public Object onTransact(Object instance,Method method, Object[] parameters) {
        Object object;
        try {
            object=method.invoke(instance,parameters);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        } catch (InvocationTargetException e) {
            throw new RuntimeException(e);
        }
        return object;
    }
}
